package org.example;

import org.springframework.stereotype.Service;

@Service
public class OrderServiceImpl implements OrderService {
    @Override
    public void add(String pname, int number) {
        System.out.println("购买了 " + pname + " 共 " + number + " 个");
    }

    @Override
    public void delete(String pname) {
        System.out.println("从购物车中删除了 " + pname);
    }

    @Override
    public int find(String pname) {
        System.out.println("查询 " + pname + " 的数量");
        return (int) (Math.random() * 10); // 模拟返回数量
    }
}
